//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<IFile.h>
///	@path	~/src/database/store/
///	@date	2007/11/21
///	@desc	File interface.

#pragma once

#include "xeres.h"

#include "lib/utilities/time.h"

#include "object/IObject.h"

#include "database/store/IStore.h"

namespace xeres {

	/*!
		\class	IFile
		\brief
	*/
	class IFile : public IStore
	{
	public:

		/// \ctor
		IFile( void );

		/// \dtor
		virtual ~IFile( void );

		DECL_IOBJECT_INTERFACE( IFile , IStore );

	public:

	//@ interface

		/*!
			\brief		Get file path.
		*/
		virtual WString GetPath( void ) = 0;

		/*!
			\brief		Seek to file pos.
		*/
		virtual bool Seek( int64 pos , bool abs_seek ) = 0;

		/*!
			\brief		Seek to end of file.
		*/
		virtual bool SeekEof( void ) = 0;

		/*!
			\brief		Get current file pos.
		*/
		virtual uint64 Tell( void ) = 0;

		/*!
			\brief		Read data from file.
		*/
		virtual size_t Read( void * data , size_t size ) = 0;

		/*!
			\brief		Write data to file.
		*/
		virtual size_t Write( const void * data , size_t size ) = 0;
	};

} // namespace xeres
